function ThumbView() {

    var imageWrapper = $('<div class="imageWrapper"></div>');

    var loader = $('<div class="windowLoader"></div>').appendTo(imageWrapper);
    var loaderImg = $('<img src="images/loading.gif" />').appendTo(loader);

    var jsonData = "";

    $.getJSON("http://127.0.0.1:8888/js/Backend/getJSONThumbs.php", {}, function (data) {

        jsonData = data;

        for (var i = 0; i < data.length; i++) {

            var thumbContainer = $("<div class='thumbContainer' picsrc='" + data[i].fileName + "' picId='" + i + "'></div>'").appendTo(imageWrapper);
            var node = "<img src='pics/thumbs/" + data[i].fileName + "' alt='thumb'/>";
            var thumbPix = $(node).appendTo(thumbContainer);

            var fileName = data[i].fileName;

            $(thumbContainer).mousedown(function (event) {
                var picID = $(this).attr('picId');

                switch (event.which) {
                    case 1:
                        new ImageView(jsonData[picID]);
                        break;
                    case 2:
                        alert('Middle mouse button pressed');
                        break;
                    case 3:
                        var url = "url(pics/" + $(this).attr("picsrc") + ")";
                        $(mainWindow).css("background-image", url);
                        event.preventDefault();

                        break;
                    default:
                        alert('You have a strange mouse');
                }
            });

            $(thumbContainer).bind("contextmenu", function (e) {
                return false;
            });

        }
    }).complete(function () {
        $(loader).remove();
    });

    AppWindow.call(this);
    this.createWindow(imageWrapper);
}

ThumbView.prototype = new AppWindow();